def count_words(filename):
    '''Calculate how many words a file contains'''
    try:
        with open(filename,encoding='utf-8') as f:
            contents=f.read()
    except FileNotFoundError:
       pass
    else:
        words=contents.split()
        num_words=len(words)
        print(f"The file {filename} has about {num_words} words ")
    
filenames=['D:\\GITEE\\study_code\\Python\\2022-11-14\\alice.txt','siddhartha.txt','D:\\GITEE\\study_code\\Python\\2022-11-14\\moby_dick.txt','D:\\GITEE\\study_code\\Python\\2022-11-14\\little_women.txt']
for filename in filenames:
    count_words(filename)